#ifndef _SDK_MEDIA_INFO_H_
#define _SDK_MEDIA_INFO_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "InCommon.h"

#if CMAKE_SENSOR_1080P
#define SENSOR_MAIN_WIDTH                       1920
#define SENSOR_MAIN_HEIGHT                      1080
#endif

#if CMAKE_SENSOR_720P
#define SENSOR_MAIN_WIDTH                       1280
#define SENSOR_MAIN_HEIGHT                      720
#endif

#define SENSOR_SUB_WIDTH                        640
#define SENSOR_SUB_HEIGHT                       360

#define DEF_SENSOR_QXGA_WIDTH                   2304
#define DEF_SENSOR_QXGA_HEIGHT                  1296
#define DEF_SENSOR_1080P_WIDTH                  1920
#define DEF_SENSOR_1080P_HEIGHT                 1080
#define DEF_SENSOR_720P_WIDTH                   1280
#define DEF_SENSOR_720P_HEIGHT                  720

/*
 * 设置帧率要和实际视频帧率一致,
 * 否则会影响APP录像和设备SD卡录像
*/
#if CMAKE_ANYKA_EV300L
#define DEF_SDK_VIDEO_FPS                       10
#else
#define DEF_SDK_VIDEO_FPS                       20
#endif

#define DEF_SDK_VIDEO_GOP                       (DEF_SDK_VIDEO_FPS * 3)

#define DEF_SDK_MIC_SIZE                        640

#if CMAKE_INGENIC_T41N
#define DEF_SDK_SPK_BUF_SIZE                    160
#else
#define DEF_SDK_SPK_BUF_SIZE                    640
#endif

#define DEF_SDK_MAX_FRAME_SIZE                  (600 * 1024)

#define DEF_SDK_ENABLE_FLIP                     1
#define DEF_SDK_DISABLE_FLIP                    0

typedef struct
{
    Com_s32 type;
    Com_pu8 buf;
    Com_u32 size;
    Com_u64 pts; /* ms */
}StSdkVideoInfo,*pStSdkVideoInfo;

typedef struct
{
    Com_pu8 buf;
    Com_u32 size;
    Com_u64 pts;
}StSdkAudioInfo,*pStSdkAudioInfo;

typedef struct
{
    Com_pu8 buf;
}StSdkQrcodeInfo,*pStSdkQrcodeInfo;

typedef struct
{
    int l;
    int r;
    int t;
    int b;
}StSdkMDAreaLocal,*pStSdkMDAreaLocal;

typedef enum
{
    SDK_FRAME_TYPE_P = 0,
    SDK_FRAME_TYPE_I,
}EnSdkVideoFrameType;

typedef enum
{
    VIDEO_EFFECT_BRIGHTNESS = 0,
    VIDEO_EFFECT_CONTRAST,
}EnSdkVideoEffect;

typedef enum
{
    NIGHT_MODE_AUTO = 0,
    NIGHT_MODE_OFF,
    NIGHT_MODE_ON,
    DAY_MODE_SWITCH,
    NIGHT_MODE_SWITCH,
}EnSdkNightMode;

int Ext_SdkMediaCom_GetVideoData(int chn,pStSdkVideoInfo info);
void Ext_SdkMediaCom_ReleaseVideoData(int chn);
int Ext_SdkMediaCom_GetMicData(pStSdkAudioInfo info);
void Ext_SdkMediaCom_ReleaseMicData(void);
int Ext_SdkMediaCom_GetMicAencData(pStSdkAudioInfo info);
void Ext_SdkMediaCom_ReleaseMicAencData(void);
int Ext_SdkMediaCom_GetQRCodeData(pStSdkQrcodeInfo info);
void Ext_SdkMediaCom_ReleaseQRCodeData(void);
int Ext_SdkMediaCom_GetMdResult(void);
void Ext_SdkMediaCom_SavePic(void);
void Ext_SdkMediaCom_GetMDAreaXY(pStSdkMDAreaLocal area);
void Ext_SdkMediaCom_RequestIDR(void);
int Ext_SdkMediaCom_SetFlip(int mode);
void Ext_SdkMediaCom_SetVpssEffect(EnSdkVideoEffect effect,int val);
void Ext_SdkMediaCom_SetSpkVolume(Com_s32 volume);
void Ext_SdkMediaCom_SetSpkGain(Com_s32 gain);

#if CMAKE_SUPPORT_AAC_DECODE
Com_s32 Ext_SdkSpk_AacDecodeInit(void);
Com_void Ext_SdkSpk_AacDecodeEnd(void);
Com_void Ext_SdkSpk_AacDestroyAdec(void);
Com_s32 Ext_SdkSpk_AacDecodeSendBuf(char *data, int data_len);
#endif

#if CMAKE_INGENIC_T41N
void Ext_SdkVideo_QRCodeStart(void);
void Ext_SdkVideo_QRCodeStop(void);
#endif

#ifdef __cplusplus
}
#endif

#endif
